package com.lantosec.hmrp.modules.internal.entity;

import java.time.LocalDateTime;
import java.util.Date;

import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.internal.vo.InternalNoteVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

/**
 * <p>
 * 评价记录 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class InternalNote extends BaseEntity<InternalNoteVO> {

    private static final long serialVersionUID = 1L;

    public InternalNote(InternalNoteVO vo) {
        this.internalNoteId = vo.getInternalNoteId();
        this.internalTaskDetailId = vo.getInternalTaskDetailId();
        this.internalTaskId = vo.getInternalTaskId();
        this.executorDeptId = vo.getExecutorDeptId();
        this.executorPositionId = vo.getExecutorPositionId();
        this.executorUserId = vo.getExecutorUserId();
        this.targetDeptId = vo.getTargetDeptId();
        this.targetPositionId = vo.getTargetPositionId();
        this.targetUserId = vo.getTargetUserId();
        this.internalItemId = vo.getInternalItemId();
        this.internalLevelId = vo.getInternalLevelId();
        this.reason = vo.getReason();
        this.createTime = vo.getCreateTime();
        this.submitTime = vo.getSubmitTime();
    }

    @Override
    public InternalNoteVO convertToVO() {
        return new InternalNoteVO(this);
    }


    /**
     * 评价记录ID
     */
    @TableId(value = "internal_note_id", type = IdType.AUTO)
    private Integer internalNoteId;

    /**
     * 评价任务明细ID
     */
    private Integer internalTaskDetailId;

    /**
     * 评价任务ID
     */
    private Integer internalTaskId;

    /**
     * 评价方ID（部门）
     */
    private String executorDeptId;

    /**
     * 评价方ID（岗位）
     */
    private String executorPositionId;

    /**
     * 评价人ID
     */
    private String executorUserId;

    /**
     * 被评价方ID(部门)
     */
    private String targetDeptId;

    /**
     * 被评价方ID(岗位)
     */
    private String targetPositionId;

    /**
     * 被评价方ID(人员)
     */
    private String targetUserId;

    /**
     * 评价项目ID
     */
    private String internalItemId;

    /**
     * 评价等级ID
     */
    private Integer internalLevelId;

    /**
     * 评价理由
     */
    private String reason;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 提交时间
     */
    private Date submitTime;


    public enum ColName {
        internal_note_id, internal_task_detail_id, internal_task_id, executor_dept_id, executor_position_id, executor_user_id, target_dept_id, target_position_id, target_user_id, internal_item_id, internal_level_id, reason, create_time, submit_time,
    }
}
